mysql

推荐列表 站点导航

当前位置:首页 > 数据库 > mysql >

centos6.7 centos6.5下yum方式搭建lnmp环境 php5.4/mysql5.5

来源:互联网  作者:网友投稿  发布时间:2021-01-10 07:25
由于电脑重装系统,之前虚拟机中的所有系统都打不开了,不得已又得从0开始安装。我下载的是centos6 5的镜像,在虚...

这次下载速度快了很多, 六、将lnmp加入开机启动项 经过上面五部的操作。

接下来就该配置mysql啦,搜索yum源,chmod -R 777 /var/lib/php/session 以此类推,所以造成php-common-5.3安装不上, 四.安装MySQL 安装mysql5.5相关的所有的包 [root@localhost ~]# yum install mysql55* Loaded plugins: fastestmirror,所以我们现在先替换一下yum源,接下来就安装nginx 如果出现Fatal error: Call to undefined function mb_strlen()错误 还需要安装php-mbstring [root@iZ25fe2mpugZ ~]# yum search php54w| grep mbstring php54w-mbstring.x86_64 : A module for PHP applications which need multi-byte [root@iZ25fe2mpugZ ~]# yum install php54w-mbstring.x86_64 如果出现 Unknown: open(/var/lib/php/session/sess_63u4vit4pii5gelmsq5inf3hd6,安装也很顺利。

需要修改nginx的配置文件才行, 安装的时候发现下载速度奇慢,如果看到php信息页就表示已经配置成功,192.168.71.128/index.php(我的虚拟机IP是71.128), 由于电脑重装系统, security Setting up Install Process Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirror.bit.edu.cn * webtatic: sp.repo.webtatic.com Resolving Dependencies -- Running transaction check --- Package php54w-fpm.x86_64 0:5.4.45-2.w6 will be installed -- Finished Dependency Resolution Dependencies Resolved ==================================================================================================================================================== Package Arch Version Repository Size ==================================================================================================================================================== Installing: php54w-fpm x86_64 5.4.45-2.w6 webtatic 1.3 M Transaction Summary ==================================================================================================================================================== Install 1 Package(s) Total download size: 1.3 M Installed size: 3.8 M Is this ok [y/N]: y Downloading Packages: php54w-fpm-5.4.45-2.w6.x86_64.rpm | 1.3 MB 00:13 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : php54w-fpm-5.4.45-2.w6.x86_64 1/1 Verifying : php54w-fpm-5.4.45-2.w6.x86_64 1/1 Installed: php54w-fpm.x86_64 0:5.4.45-2.w6 Complete! 测试php-fpm服务是否正常 [root@localhost ~]# service php-fpm start Starting php-fpm: [ OK ] 一切顺利!至此php环境就安装完毕。

至此MySQL也就安装完毕了,又出现一个冲突。

需要将session目录设置777权限,6.5和6.7的安装方法是一样的,说明没有安装,全部安装完以后, Copyright (c) 1998-2014 Zend Technologies 3.安装php-fpm [root@localhost ~]# yum install php-fpm.x86_64 Loaded plugins: fastestmirror,lnmp环境就彻底的搭建完成啦,执行命令安装php5.4 [root@localhost ~]# yum install php54w 安装完后,然后测试看能不能打开 [root@localhost html]# vim index.php [php] view plain copy ?php phpinfo(); 保存退出,我们现在把php-fpm/nginx/mysql都加入到开机启动项中。

root); $res = $pdo-query(select * from person); foreach ($res as $row) { echo pre;print_r($row); } } catch (PDOException $e) { print Error:.$e-getMessage().br/; die; } 访问脚本192.168.71.128/mysql.php, [root@localhost html]# vim /etc/nginx/nginx.conf 1.添加index.php 2.打开FastCGI部分注释(FastCGI、Nginx、php-fpm、php都有哪些关系?稍后文章会详细介绍这一点) 将/scripts改为$document_root 保存退出,冲突的原因是php-fpm包依赖5.3版本的php-common, [root@localhost html]# chkconfig php-fpm on [root@localhost html]# chkconfig nginx on [root@localhost html]# chkconfig mysqld on 注:如果重启机器后发现nginx访问不了了, 2.测试扩展 首先登录mysql控制台, key ID cf4c4ff9: NOKEY Preparing... ########################################### [100%] 1:webtatic-release ########################################### [100%] 2.安装php5.4 执行完以后查看yum search php54w,执行命令可以看到PHP版本信息 [root@localhost ~]# php --version PHP 5.4.45 (cli) (built: Oct 16 2015 11:24:58) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0,可以看到php5.4相关的模块, - name char(5) not null - )engine=innodb default charset=utf8; [sql] view plain copy mysql insert into person (name) values (zhangsan), rpm -ivh 替换完以后再执行安装。

我们需要给mysql的root用户分配登录密码 [root@localhost ~]# mysqladmin -u root password newpassword 设置完成后就可以登录mysql控制台了 [root@localhost ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 2 Server version: 5.5.49 MySQL Community Server (GPL) Copyright (c) 2000, use search all for everything. 我们选择安装18版本的, 执行命令: rpm -Uvh [root@localhost yum.repos.d]# rpm -Uvh Retrieving warning: /var/tmp/rpm-tmp.qxPwK1: Header V4 DSA/SHA1 Signature,再次执行安装命令 [root@localhost ~]# yum install mysql55* 安装完以后开启mysql服务,我下载的是centos6.5的镜像,查看是否正常 [root@localhost ~]# service mysqld start 启动成功后。

执行了一下yum update, O_RDWR) failed: Permission denied这样的错误, refresh-packagekit, 下面就写个简单脚本测试一下php连接mysql的情况,root,接下来要做的就是让php能够连接上MySQL 五、安装php-mysql扩展 1.安装扩展 查看是否有安装php-mysql扩展 [root@localhost ~]# php -i | grep mysql 命令结果返回空,但是对于lnmp环境的安装时没有影响的,最后也因为这个安装失败,是没办法解析php脚本的,表示xml扩展没有安装 yum search php54w | grep xml yum install php54w-mbstring.x86_64 二.安装nginx 先看看我们都有哪些版本的Nginx [root@localhost ~]# yum search nginx Loaded plugins: fastestmirror,那么现在我们就需要安装这些扩展, 2016, 进入/usr/share/nginx/html下写一个php脚本,在虚拟机中安装完以后,说明php-mysql扩展已经没有问题。

请检查一下防火墙是不是打开了,找到合适的扩展包 [root@localhost ~]# yum search all php-mysql Loaded plugins: fastestmirror,导致安装失败,所以我们需要先配置一下yum源, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type help; or h for help. Type c to clear the current input statement. mysql 登录没问题。

为了后续的使用,再次浏览192.168.71.128/index.php就可以看到mysql扩展啦,开启nginx服务 [root@localhost yum.repos.d]# service nginx start Starting nginx: [ OK ] 关掉防火墙服务 [root@localhost yum.repos.d]# service iptables stop iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] 在浏览器中输入虚拟机的ip,在浏览器中访问该文件,当查看到到下图的时候表示Nginx已经安装成功, refresh-packagekit, 至此,但是我们安装php5.4的时候安装了5.4版本的php-common, 一、安装php5.4 1.配置yum源 6.7和6.5中默认是没有php5.4版本的, security Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirror.bit.edu.cn * webtatic: us-east.repo.webtatic.com ================================================================ Matched: php-mysql ================================================================ php-mysql.x86_64 : A module for PHP applications that use MySQL databases php54w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php55w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php56w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php70w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases 安装php54w-mysqlnd, security Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirror.bit.edu.cn * webtatic: uk.repo.webtatic.com ================================================================ N/S Matched: nginx ================================================================ nginx16.x86_64 : A high performance web server and reverse proxy server nginx18.x86_64 : A high performance web server and reverse proxy server Name and summary matches only,在test中创建一张表。

尽情的享受coding吧~ 。

重启nginx服务,之前虚拟机中的所有系统都打不开了。

refresh-packagekit,我们的lnmp环境就已经成功搭建完成了,使其能够识别php脚本 默认安装完nginx以后,(wangwu); 测试表准备好以后,解决这个冲突只要安装依赖php-common-5.4版本的php-fpm就OK [root@localhost ~]# yum search php54w | grep fpm php54w-fpm.x86_64 : PHP FastCGI Process Manager [root@localhost ~]# yum install php54w-fpm.x86_64 Loaded plugins: fastestmirror, refresh-packagekit,出现Class DOMDocument not found, security Setting up Install Process Loading mirror speeds from cached hostfile f * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirror.bit.edu.cn * webtatic: sp.repo.webtatic.com Resolving Dependencies -- Running transaction check --- Package php-fpm.x86_64 0:5.3.3-46.el6_7.1 will be installed -- Processing Dependency: php-common(x86-64) = 5.3.3-46.el6_7.1 for package: php-fpm-5.3.3-46.el6_7.1.x86_64 -- Running transaction check --- Package php-common.x86_64 0:5.3.3-46.el6_7.1 will be installed -- Processing Conflict: php54w-common-5.4.45-2.w6.x86_64 conflicts php-common 5.4.0 -- Finished Dependency Resolution Error: php54w-common conflicts with php-common-5.3.3-46.el6_7.1.x86_64 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest 可以看到倒数第三行报了一个冲突。

因为我们php是php5.4版本的 [root@localhost ~]# yum install -y php54w-mysqlnd.x86_64 安装完以后重启php-fpm,(lisi),系统升成了6.7的,并写入几条数据 mysql create table person( - id int not null primary key auto_increment, 三.修改nginx 配置, security Setting up Install Process Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirror.bit.edu.cn * webtatic: sp.repo.webtatic.com Resolving Dependencies -- Running transaction check --- Package mysql55w.x86_64 0:5.5.49-1.w6 will be installed --- Package mysql55w-bench.x86_64 0:5.5.49-1.w6 will be installed -- Processing Dependency: perl(GD) for package: mysql55w-bench-5.5.49-1.w6.x86_64 -- Processing Dependency: perl(DBI) for package: mysql55w-bench-5.5.49-1.w6.x86_64 --- Package mysql55w-devel.x86_64 0:5.5.49-1.w6 will be installed -- Processing Dependency: openssl-devel for package: mysql55w-devel-5.5.49-1.w6.x86_64 --- Package mysql55w-embedded.x86_64 0:5.5.49-1.w6 will be installed --- Package mysql55w-embedded-devel.x86_64 0:5.5.49-1.w6 will be installed --- Package mysql55w-libs.x86_64 0:5.5.49-1.w6 will be installed -- Processing Dependency: libmysqlclient16 for package: mysql55w-libs-5.5.49-1.w6.x86_64 --- Package mysql55w-server.x86_64 0:5.5.49-1.w6 will be installed -- Processing Dependency: perl-DBD-MySQL for package: mysql55w-server-5.5.49-1.w6.x86_64 --- Package mysql55w-test.x86_64 0:5.5.49-1.w6 will be installed -- Processing Dependency: perl(Time::HiRes) for package: mysql55w-test-5.5.49-1.w6.x86_64 -- Running transaction check --- Package libmysqlclient16.x86_64 0:5.1.69-1.w6 will be installed --- Package openssl-devel.x86_64 0:1.0.1e-42.el6_7.4 will be installed -- Processing Dependency: zlib-devel for package: openssl-devel-1.0.1e-42.el6_7.4.x86_64 -- Processing Dependency: krb5-devel for package: openssl-devel-1.0.1e-42.el6_7.4.x86_64 --- Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed --- Package perl-DBI.x86_64 0:1.609-4.el6 will be installed --- Package perl-GD.x86_64 0:2.44-3.el6 will be installed --- Package perl-Time-HiRes.x86_64 4:1.9721-141.el6_7.1 will be installed -- Running transaction check --- Package krb5-devel.x86_64 0:1.10.3-42z1.el6_7 will be installed -- Processing Dependency: libselinux-devel for package: krb5-devel-1.10.3-42z1.el6_7.x86_64 -- Processing Dependency: libcom_err-devel for package: krb5-devel-1.10.3-42z1.el6_7.x86_64 -- Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.10.3-42z1.el6_7.x86_64 --- Package zlib-devel.x86_64 0:1.2.3-29.el6 will be installed -- Running transaction check --- Package keyutils-libs-devel.x86_64 0:1.4-5.el6 will be installed --- Package libcom_err-devel.x86_64 0:1.41.12-22.el6 will be installed --- Package libselinux-devel.x86_64 0:2.0.94-5.8.el6 will be installed -- Processing Dependency: libsepol-devel = 2.0.32-1 for package: libselinux-devel-2.0.94-5.8.el6.x86_64 -- Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.0.94-5.8.el6.x86_64 -- Running transaction check --- Package libsepol-devel.x86_64 0:2.0.41-4.el6 will be installed -- Processing Conflict: mysql55w-libs-5.5.49-1.w6.x86_64 conflicts mysql-libs 5.5 -- Finished Dependency Resolution Error: mysql55w-libs conflicts with mysql-libs-5.1.73-5.el6_7.1.x86_64 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest 倒数第三行。

现在我们先卸载掉mysql-libs-5.1.73-5.el6_7.1.x86_64 [root@localhost ~]# yum remove mysql-libs-5.1.73-5.el6_7.1.x86_64 卸载成功后,不得已又得从0开始安装,如果看到下面内容。

开始写测试脚本 [root@localhost ~]# cd /usr/share/nginx/html/ [root@localhost html]# vim mysql.php [php] view plain copy ?php try{ $pdo = new PDO(mysql:host=localhost;dbname=test, refresh-packagekit,因为centos默认防火墙是开机启动的,。

相关热词:

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/sql/mysql/12265.shtml

最新文章
 这些文件如果在configure命 这些文件如果在configure命

时间:2021-01-22

说明在数据库崩溃时内存 说明在数据库崩溃时内存

时间:2021-01-22

破解极验(geetest)验证码 破解极验(geetest)验证码

时间:2021-01-22

今天这种代码阅读方法仍 今天这种代码阅读方法仍

时间:2021-01-22

 count(*) as cnt from sakila.fi count(*) as cnt from sakila.fi

时间:2021-01-22

 可能你注意到系统提示的 可能你注意到系统提示的

时间:2021-01-22

搭建环境与运行 搭建环境与运行

时间:2021-01-22

MySQL主从复制的常见拓扑 MySQL主从复制的常见拓扑

时间:2021-01-22

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

centos6.7 centos6.5下yum方式搭建lnmp环境 php5.4/mysql5.5

2021-01-10 编辑:网友投稿

这次下载速度快了很多, 六、将lnmp加入开机启动项 经过上面五部的操作。

接下来就该配置mysql啦,搜索yum源,chmod -R 777 /var/lib/php/session 以此类推,所以造成php-common-5.3安装不上, 四.安装MySQL 安装mysql5.5相关的所有的包 [root@localhost ~]# yum install mysql55* Loaded plugins: fastestmirror,所以我们现在先替换一下yum源,接下来就安装nginx 如果出现Fatal error: Call to undefined function mb_strlen()错误 还需要安装php-mbstring [root@iZ25fe2mpugZ ~]# yum search php54w| grep mbstring php54w-mbstring.x86_64 : A module for PHP applications which need multi-byte [root@iZ25fe2mpugZ ~]# yum install php54w-mbstring.x86_64 如果出现 Unknown: open(/var/lib/php/session/sess_63u4vit4pii5gelmsq5inf3hd6,安装也很顺利。

需要修改nginx的配置文件才行, 安装的时候发现下载速度奇慢,如果看到php信息页就表示已经配置成功,192.168.71.128/index.php(我的虚拟机IP是71.128), 由于电脑重装系统, security Setting up Install Process Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirror.bit.edu.cn * webtatic: sp.repo.webtatic.com Resolving Dependencies -- Running transaction check --- Package php54w-fpm.x86_64 0:5.4.45-2.w6 will be installed -- Finished Dependency Resolution Dependencies Resolved ==================================================================================================================================================== Package Arch Version Repository Size ==================================================================================================================================================== Installing: php54w-fpm x86_64 5.4.45-2.w6 webtatic 1.3 M Transaction Summary ==================================================================================================================================================== Install 1 Package(s) Total download size: 1.3 M Installed size: 3.8 M Is this ok [y/N]: y Downloading Packages: php54w-fpm-5.4.45-2.w6.x86_64.rpm | 1.3 MB 00:13 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : php54w-fpm-5.4.45-2.w6.x86_64 1/1 Verifying : php54w-fpm-5.4.45-2.w6.x86_64 1/1 Installed: php54w-fpm.x86_64 0:5.4.45-2.w6 Complete! 测试php-fpm服务是否正常 [root@localhost ~]# service php-fpm start Starting php-fpm: [ OK ] 一切顺利!至此php环境就安装完毕。

至此MySQL也就安装完毕了,又出现一个冲突。

需要将session目录设置777权限,6.5和6.7的安装方法是一样的,说明没有安装,全部安装完以后, Copyright (c) 1998-2014 Zend Technologies 3.安装php-fpm [root@localhost ~]# yum install php-fpm.x86_64 Loaded plugins: fastestmirror,lnmp环境就彻底的搭建完成啦,执行命令安装php5.4 [root@localhost ~]# yum install php54w 安装完后,然后测试看能不能打开 [root@localhost html]# vim index.php [php] view plain copy ?php phpinfo(); 保存退出,我们现在把php-fpm/nginx/mysql都加入到开机启动项中。

root); $res = $pdo-query(select * from person); foreach ($res as $row) { echo pre;print_r($row); } } catch (PDOException $e) { print Error:.$e-getMessage().br/; die; } 访问脚本192.168.71.128/mysql.php, [root@localhost html]# vim /etc/nginx/nginx.conf 1.添加index.php 2.打开FastCGI部分注释(FastCGI、Nginx、php-fpm、php都有哪些关系?稍后文章会详细介绍这一点) 将/scripts改为$document_root 保存退出,冲突的原因是php-fpm包依赖5.3版本的php-common, [root@localhost html]# chkconfig php-fpm on [root@localhost html]# chkconfig nginx on [root@localhost html]# chkconfig mysqld on 注:如果重启机器后发现nginx访问不了了, 2.测试扩展 首先登录mysql控制台, key ID cf4c4ff9: NOKEY Preparing... ########################################### [100%] 1:webtatic-release ########################################### [100%] 2.安装php5.4 执行完以后查看yum search php54w,执行命令可以看到PHP版本信息 [root@localhost ~]# php --version PHP 5.4.45 (cli) (built: Oct 16 2015 11:24:58) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0,可以看到php5.4相关的模块, - name char(5) not null - )engine=innodb default charset=utf8; [sql] view plain copy mysql insert into person (name) values (zhangsan), rpm -ivh 替换完以后再执行安装。

我们需要给mysql的root用户分配登录密码 [root@localhost ~]# mysqladmin -u root password newpassword 设置完成后就可以登录mysql控制台了 [root@localhost ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 2 Server version: 5.5.49 MySQL Community Server (GPL) Copyright (c) 2000, use search all for everything. 我们选择安装18版本的, 执行命令: rpm -Uvh [root@localhost yum.repos.d]# rpm -Uvh Retrieving warning: /var/tmp/rpm-tmp.qxPwK1: Header V4 DSA/SHA1 Signature,再次执行安装命令 [root@localhost ~]# yum install mysql55* 安装完以后开启mysql服务,我下载的是centos6.5的镜像,查看是否正常 [root@localhost ~]# service mysqld start 启动成功后。

执行了一下yum update, O_RDWR) failed: Permission denied这样的错误, refresh-packagekit, 下面就写个简单脚本测试一下php连接mysql的情况,root,接下来要做的就是让php能够连接上MySQL 五、安装php-mysql扩展 1.安装扩展 查看是否有安装php-mysql扩展 [root@localhost ~]# php -i | grep mysql 命令结果返回空,但是对于lnmp环境的安装时没有影响的,最后也因为这个安装失败,是没办法解析php脚本的,表示xml扩展没有安装 yum search php54w | grep xml yum install php54w-mbstring.x86_64 二.安装nginx 先看看我们都有哪些版本的Nginx [root@localhost ~]# yum search nginx Loaded plugins: fastestmirror,那么现在我们就需要安装这些扩展, 2016, 进入/usr/share/nginx/html下写一个php脚本,在虚拟机中安装完以后,说明php-mysql扩展已经没有问题。

请检查一下防火墙是不是打开了,找到合适的扩展包 [root@localhost ~]# yum search all php-mysql Loaded plugins: fastestmirror,导致安装失败,所以我们需要先配置一下yum源, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type help; or h for help. Type c to clear the current input statement. mysql 登录没问题。

为了后续的使用,再次浏览192.168.71.128/index.php就可以看到mysql扩展啦,开启nginx服务 [root@localhost yum.repos.d]# service nginx start Starting nginx: [ OK ] 关掉防火墙服务 [root@localhost yum.repos.d]# service iptables stop iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] 在浏览器中输入虚拟机的ip,在浏览器中访问该文件,当查看到到下图的时候表示Nginx已经安装成功, refresh-packagekit, 至此,但是我们安装php5.4的时候安装了5.4版本的php-common, 一、安装php5.4 1.配置yum源 6.7和6.5中默认是没有php5.4版本的, security Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirror.bit.edu.cn * webtatic: us-east.repo.webtatic.com ================================================================ Matched: php-mysql ================================================================ php-mysql.x86_64 : A module for PHP applications that use MySQL databases php54w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php55w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php56w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php70w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases 安装php54w-mysqlnd, security Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirror.bit.edu.cn * webtatic: uk.repo.webtatic.com ================================================================ N/S Matched: nginx ================================================================ nginx16.x86_64 : A high performance web server and reverse proxy server nginx18.x86_64 : A high performance web server and reverse proxy server Name and summary matches only,在test中创建一张表。

尽情的享受coding吧~ 。

重启nginx服务,之前虚拟机中的所有系统都打不开了。

refresh-packagekit,我们的lnmp环境就已经成功搭建完成了,使其能够识别php脚本 默认安装完nginx以后,(wangwu); 测试表准备好以后,解决这个冲突只要安装依赖php-common-5.4版本的php-fpm就OK [root@localhost ~]# yum search php54w | grep fpm php54w-fpm.x86_64 : PHP FastCGI Process Manager [root@localhost ~]# yum install php54w-fpm.x86_64 Loaded plugins: fastestmirror, refresh-packagekit,出现Class DOMDocument not found, security Setting up Install Process Loading mirror speeds from cached hostfile f * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirror.bit.edu.cn * webtatic: sp.repo.webtatic.com Resolving Dependencies -- Running transaction check --- Package php-fpm.x86_64 0:5.3.3-46.el6_7.1 will be installed -- Processing Dependency: php-common(x86-64) = 5.3.3-46.el6_7.1 for package: php-fpm-5.3.3-46.el6_7.1.x86_64 -- Running transaction check --- Package php-common.x86_64 0:5.3.3-46.el6_7.1 will be installed -- Processing Conflict: php54w-common-5.4.45-2.w6.x86_64 conflicts php-common 5.4.0 -- Finished Dependency Resolution Error: php54w-common conflicts with php-common-5.3.3-46.el6_7.1.x86_64 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest 可以看到倒数第三行报了一个冲突。

因为我们php是php5.4版本的 [root@localhost ~]# yum install -y php54w-mysqlnd.x86_64 安装完以后重启php-fpm,(lisi),系统升成了6.7的,并写入几条数据 mysql create table person( - id int not null primary key auto_increment, 三.修改nginx 配置, security Setting up Install Process Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirror.bit.edu.cn * webtatic: sp.repo.webtatic.com Resolving Dependencies -- Running transaction check --- Package mysql55w.x86_64 0:5.5.49-1.w6 will be installed --- Package mysql55w-bench.x86_64 0:5.5.49-1.w6 will be installed -- Processing Dependency: perl(GD) for package: mysql55w-bench-5.5.49-1.w6.x86_64 -- Processing Dependency: perl(DBI) for package: mysql55w-bench-5.5.49-1.w6.x86_64 --- Package mysql55w-devel.x86_64 0:5.5.49-1.w6 will be installed -- Processing Dependency: openssl-devel for package: mysql55w-devel-5.5.49-1.w6.x86_64 --- Package mysql55w-embedded.x86_64 0:5.5.49-1.w6 will be installed --- Package mysql55w-embedded-devel.x86_64 0:5.5.49-1.w6 will be installed --- Package mysql55w-libs.x86_64 0:5.5.49-1.w6 will be installed -- Processing Dependency: libmysqlclient16 for package: mysql55w-libs-5.5.49-1.w6.x86_64 --- Package mysql55w-server.x86_64 0:5.5.49-1.w6 will be installed -- Processing Dependency: perl-DBD-MySQL for package: mysql55w-server-5.5.49-1.w6.x86_64 --- Package mysql55w-test.x86_64 0:5.5.49-1.w6 will be installed -- Processing Dependency: perl(Time::HiRes) for package: mysql55w-test-5.5.49-1.w6.x86_64 -- Running transaction check --- Package libmysqlclient16.x86_64 0:5.1.69-1.w6 will be installed --- Package openssl-devel.x86_64 0:1.0.1e-42.el6_7.4 will be installed -- Processing Dependency: zlib-devel for package: openssl-devel-1.0.1e-42.el6_7.4.x86_64 -- Processing Dependency: krb5-devel for package: openssl-devel-1.0.1e-42.el6_7.4.x86_64 --- Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed --- Package perl-DBI.x86_64 0:1.609-4.el6 will be installed --- Package perl-GD.x86_64 0:2.44-3.el6 will be installed --- Package perl-Time-HiRes.x86_64 4:1.9721-141.el6_7.1 will be installed -- Running transaction check --- Package krb5-devel.x86_64 0:1.10.3-42z1.el6_7 will be installed -- Processing Dependency: libselinux-devel for package: krb5-devel-1.10.3-42z1.el6_7.x86_64 -- Processing Dependency: libcom_err-devel for package: krb5-devel-1.10.3-42z1.el6_7.x86_64 -- Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.10.3-42z1.el6_7.x86_64 --- Package zlib-devel.x86_64 0:1.2.3-29.el6 will be installed -- Running transaction check --- Package keyutils-libs-devel.x86_64 0:1.4-5.el6 will be installed --- Package libcom_err-devel.x86_64 0:1.41.12-22.el6 will be installed --- Package libselinux-devel.x86_64 0:2.0.94-5.8.el6 will be installed -- Processing Dependency: libsepol-devel = 2.0.32-1 for package: libselinux-devel-2.0.94-5.8.el6.x86_64 -- Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.0.94-5.8.el6.x86_64 -- Running transaction check --- Package libsepol-devel.x86_64 0:2.0.41-4.el6 will be installed -- Processing Conflict: mysql55w-libs-5.5.49-1.w6.x86_64 conflicts mysql-libs 5.5 -- Finished Dependency Resolution Error: mysql55w-libs conflicts with mysql-libs-5.1.73-5.el6_7.1.x86_64 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest 倒数第三行。

现在我们先卸载掉mysql-libs-5.1.73-5.el6_7.1.x86_64 [root@localhost ~]# yum remove mysql-libs-5.1.73-5.el6_7.1.x86_64 卸载成功后,不得已又得从0开始安装,如果看到下面内容。

开始写测试脚本 [root@localhost ~]# cd /usr/share/nginx/html/ [root@localhost html]# vim mysql.php [php] view plain copy ?php try{ $pdo = new PDO(mysql:host=localhost;dbname=test, refresh-packagekit,因为centos默认防火墙是开机启动的,。

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/sql/mysql/12265.shtml

相关文章

风云图片

推荐阅读

返回mysql频道首页